import request from '@/utils/request'

// 查询设备实况列表
export function listDevice(query) {
  return request({
    url: '/snowRemoving/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备实况详细
export function getDevice(serialNumber) {
  return request({
    url: '/snowRemoving/device/' + serialNumber,
    method: 'get'
  })
}

// 新增设备实况
export function addDevice(data) {
  return request({
    url: '/snowRemoving/device',
    method: 'post',
    data: data
  })
}

// 修改设备实况
export function updateDevice(data) {
  return request({
    url: '/snowRemoving/device',
    method: 'put',
    data: data
  })
}

// 删除设备实况
export function delDevice(serialNumber) {
  return request({
    url: '/snowRemoving/device/' + serialNumber,
    method: 'delete'
  })
}


// 查询设备下拉树结构
export function deiceTreeSelect() {
  return request({
    url: '/snowRemoving/device/deiceTreeSelect',
    method: 'get'
  })
}



// 查询设备数据
export function deviceAttributeList(data) {
  return request({
    url: '/snowRemoving/device/attributeList',
    method: 'get',
    params: data
  })
}

// 启用设备
export function handleAttributeEnable(data) {
  return request({
    url: '/snowRemoving/device/attributeEnable',
    method: 'post',
    params: data
  })
}


// 启用设备
export function handleAttributeDisable(data) {
  return request({
    url: '/snowRemoving/device/attributeDisable',
    method: 'post',
    params: data
  })
}
